package com.heima.wemedia.service.impl;

import com.aliyuncs.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.common.dtos.ArticleCommentPageDto;
import com.heima.common.dtos.PageResult;
import com.heima.common.dtos.ResponseResult;
import com.heima.feign.article.ArticleFeignClient;
import com.heima.model.comment.dtos.CommentPageDto;
import com.heima.wemedia.mapper.WmCommentMapper;
import com.heima.wemedia.pojo.WmComment;
import com.heima.wemedia.service.WmCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WmCommentServiceImpl extends ServiceImpl<WmCommentMapper, WmComment> implements WmCommentService {
    @Autowired
    ArticleFeignClient articleFeignClient;

    @Override
    public PageResult findByPage(ArticleCommentPageDto dto) {
        List<CommentPageDto> page = articleFeignClient.findByPage(dto);
        return new PageResult(dto.getPage(),dto.getSize(),Long.valueOf(page.size()),page);
    }
}
